﻿using Common;
using Network.UpdateData;
using System.Net.Sockets;

namespace SFJDService.SocketHandle
{
    /// <summary>
    /// 接收到指令后直接在data.xml文件里添加数据
    /// </summary>
    public class PH01AddData : PacketHandle
    {
        /// <summary>
        /// 直接在xml文件里添加data数据
        /// UDP, code 1014
        /// </summary>
        public PH01AddData(Socket socket, Packet packet) : base(socket, packet) { }

        protected override void Handle()
        {
            if (Message != null)
            {
                ClassData dat = new ClassData();
                dat.DecodingFromString(Message);
                Runtime.xmlData.AddData(dat);
            }
        }
    }
}
